<template>
  <div class="bi">
    <div class="imglist">
      <div class="imgleft">
        <img :src="img[0].largeimg" alt />
      </div>
      <div class="imgright">
        <img :src="img[0].smallimg1" alt />
        <img :src="img[0].smallimg2" alt />
      </div>
      <div class="tags">
        <div class="tag" style="font-weight: bold;">{{tit[0].tit1}}</div>
        <div class="tag" style="font-weight: bold;">{{tit[0].tit2}}</div>
        <div class="tag" style="font-weight: bold;">{{tit[0].tit3}}</div>
      </div>
    </div>

    <div class="navlist">
      <div class="nav1">
        <h2>
          {{name}}
          <span>{{subtitle}}</span>
        </h2>
        <h3>
          {{price}}
          <span>万</span>
        </h3>
      </div>
      <div class="nav2">
        <p>{{house}}</p>
      </div>
      <div class="nav3">
        <div class="nav31">
          <div class="nav-left">
            <img :src="people" alt />
          </div>
          <div class="nav-right">
            <h4>{{pemane}}</h4>
            <p>房源动态找我咨询</p>
          </div>
        </div>
        <div class="nav32">
          <img src="kandian/6.png" alt />
        </div>
        <div class="nav33">
          <img src="kandian/7.png" alt />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: [
    "name",
    "img",
    "pemane",
    "price",
    "tit",
    "house",
    "people",
    "subtitle",
  ],
  created() {
    //在页面加载时读取sessionStorage里的状态信息
    if (sessionStorage.getItem("store")) {
      this.$store.replaceState(
        Object.assign(
          {},
          this.$store.state,
        //   JSON.parse(sessionStorage.getItem("store"))
        )
      );
    } //在页面刷新时将vuex里的信息保存到sessionStorage里
    window.addEventListener("beforeunload", () => {
      sessionStorage.setItem("store", JSON.stringify(this.$store.state));
    });
  },
};
</script>
<style  scoped>
.bi {
  width: 90%;
  height: 3rem;
  margin: 0.16rem auto;
  border-radius: 0.05rem;
  border: 0.01rem solid #efefef;
  box-shadow: 0rem 0.01rem 0.11rem 0.02rem #eeeeee;
}
.imglist {
  width: 100%;
  height: 1.37rem;
  display: flex;
  justify-content: space-between;
  position: relative;
}
.tags {
  position: absolute;
  bottom: 0.1rem;
  left: 0;
  display: flex;
  margin-left: 0.1rem;
}
.imglist .imgleft {
  width: 67%;
  height: 1.37rem;
}
.imglist .imgright {
  width: 32.4%;
  height: 1.37rem;
}
.imgleft img {
  width: 100%;
  height: 1.37rem;
}
.imgright img {
  width: 100%;
  height: 0.685rem;
}
.navlist {
  width: 90%;
  height: 1.41rem;
  display: flex;
  margin: 0.1rem auto;
  flex-direction: column;
  justify-content: space-around;
}
.tags .tag {
  display: inline-block;
  padding: 0.04rem;
  margin-right: 0.04rem;
  height: 0.2rem;
  background: #fff;
  border-radius: 0.04533rem;
  font-family: PingFangSC-Semibold;
  font-size: 0.12rem;
  color: #222;
  letter-spacing: 0;
  line-height: 0.11rem;
}
.nav-left {
  border-radius: 50%;
  float: left;
  overflow: hidden;
}
.nav-left img {
  width: 100%;
}
.nav1 {
  height: 0.18rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.nav1 h2 {
  font-size: 0.16rem;
  font-weight: 900;
}
.nav1 h2 span {
  font-size: 0.12rem;
  font-weight: 500;
  margin-left: 0.1rem;
}
.nav1 h3 {
  font-size: 0.14rem;
  font-weight: 700;
  color: #d21a00;
}
.nav2 {
  height: 0.4rem;
  width: 100%;
  overflow: hidden;
}
.nav2 p {
  font-size: 0.14rem;
}
.nav3 {
  height: 0.5rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.1rem;
}
.nav3 img {
  width: 0.4rem;
}
.nav31 {
  width: 48%;
  display: flex;
  justify-content: space-between;
}
.nav-right h4 {
  font-size: 0.14rem;
}
.nav-right p {
  font-size: 0.12rem;
}
.nav32 {
  margin-left: 0.56rem;
}
</style>